< (Less Than)

The Less Than operator is used to compare the value on the left to the value on the right. If the left operand is less than the right operand, a value of true will be returned. If the left operand is greater than or equal to the right operand, a false value will be returned. It should be noted that if either of the operators are of a data type other than a Number, an attempt is made to convert the operand(s) to the Number data type before evaulating the operands.

syntax:

numberOne < numberTwo

EXAMPLE

var operandOne = new String("67");

if (operandOne < 100) {

document.write("The result is true")

} else {

document.write("The result is false")

}

This example declares a variable, variableOne, and stuffs it with the string "67". The Less Than operator is then used to determine whether the "67" (now converted to a Number data type) is less than the Number 100. Since it is, the if / else statement will return the message "The result is true".